package com.briup.day04;

import java.util.Scanner;

public class Test_While {
    public static void main01(String[] args) {
        int zf = 8844430;
        double paper = 0.1;
        int count = 0;
        while (paper <= zf) {
            paper *= 2;
            count = count + 1;
        }
        System.out.println("需要折叠" + count + "次");
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println();
        int n = sc.nextInt();
        int m = sc.nextInt();
        int max = n > m ? n : m;
        int min = m < n ? m : n;
        if (max % min == 0) {
            System.out.println(max + "是最大公约数");
            System.out.println(min + "是最小公倍数");
        } else {
            int c = max % min;
            while (c != 0) {
                max = min;
                min = c;
                c = max % min;
            }
            System.out.println(min + "最大公约数" + (m * n) / min + "是最小公倍数");
        }
    }
}
